package com.tony.service.dubboImpl;

import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
import com.tony.service.SysInfoApi;

public class SysInfoApiImpl implements SysInfoApi{
    @Override
    public String getSysInfo(String name) {
        System.out.println("被远程调用，参数："+name);
        return "系统："+name;
    }

    @Override
    public String getSysInfo(String addres, int port) {
        System.out.println("被远程调用，参数："+addres+","+port);
        return sysInfos().get(addres,port);
    }

    public Table<String,Integer,String> sysInfos(){
        Table<String,Integer,String> table = HashBasedTable.create();
        table.put("localhost",8080,"test");
        table.put("127.0.0.1",8080,"localhost");

        return table;
    }
}
